package com.taoym.voucher.common.enums;

import lombok.Getter;

/**
 * @coder taoym
 * @datetime 2021/6/4 17:14
 * @desc 是否为正式用户枚举
 */
@Getter
public enum UserFormalEnum {
    YES(1, "正式用户"),
    NO(0, "非正式用户");

    private final Integer code;
    private final String msg;

    UserFormalEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String getMsg(Integer code) {
        for (UserFormalEnum userFormalEnum : values()) {
            if (code.equals(userFormalEnum.code)) {
                return userFormalEnum.msg;
            }
        }
        return null;
    }
}
